package jpf.nextsearch.ds.dao.impl;

import jpf.nextsearch.ds.dao.ResourceDao;
import jpf.nextsearch.ds.dao.base.AbstractDaoHibernate;
import jpf.nextsearch.ds.model.ResourceVO;
import jpf.nextsearch.ds.model.types.ResourceActiveTable;

import org.hibernate.Query;

/**
 * @author <a href="mailto:jacek.pruszkowski@gmail.com">Jacek Pruszkowski</a>
 * 
 */
public class ResourceDaoImpl extends AbstractDaoHibernate<ResourceVO> implements ResourceDao {

	public ResourceDaoImpl() {
		super(ResourceVO.class);
	}
	
	public int removeResourceByActiveTable(ResourceActiveTable active) {
		String hql = "delete from ResourceVO where activeTable = :active";
		Query query = getSession().createQuery(hql).setParameter("active", active);
		return query.executeUpdate();
	}
	
	
}
